home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Online / YAPY / EdMenu next >
AmigaDOS Script File  |  2002-10-27  |  4KB  |  152 lines

  1. .key FILE,CHOICE
  2. .bra {
  3. .ket }
  4. ;
  5. ; YAPY v1.3 © 1997 Fredrik Rambris. All rights reserved.
  6. ; A script to do the common things with PGP in YAM
  7. ;
  8. ;
  9. ; SelectPGPKey V1.x is © 1997 by J.Kempkes
  10. ; Look for PGPgoesMUI!
  11. ; Knowing MUI_MCX_Prefs?
  12. ;
  13. ; This script relies on the two environment-variables PGPPATH and EDITOR
  14. ;
  15. ; Set PGPPATH to the path where the PGP binary is.
  16. ;
  17. ; Set the environment-variable EDITOR to the texteditor of your choice.
  18. ; Ex.  SETENV EDITOR "C:Ed"
  19. ; And then  COPY ENV:EDITOR ENVARC:  to make it permanent
  20. ;
  21. ;
  22. ; *** Put your own KeyID between the "s. Be sure to put 0x in front of it ***
  23.  
  24. Set keyid ""
  25.  
  26. ;
  27. ; DO NOT TOUCH ANYTHING BELOW!
  28. ;
  29.  
  30. LAB begin
  31. IF "$PGPPATH" EQ ""
  32.     UNSET choice
  33.     SET choice `REQUESTCHOICE TITLE "YAPY v1.3 © 1997 Fredrik Rambris" BODY "You must set the PGPPATH environment-variable!" GADGETS "Help me do it|I'll do it later"`
  34.  
  35.     IF $choice EQ 1
  36.         SETENV PGPPATH `REQUESTFILE TITLE "Select drawer where PGP is" DRAWERSONLY NOICONS`
  37.         COPY ENV:PGPPATH ENVARC:
  38.         SKIP begin BACK
  39.     ENDIF
  40.  
  41.     ENDCLI >NIL:
  42. ENDIF
  43.  
  44. IF "{CHOICE}" EQ ""
  45.     UNSET choice
  46.     SET choice `REQUESTCHOICE TITLE "YAPY v1.3 © 1997 Fredrik Rambris" BODY "Please select what to do with your mail" GADGETS "Edit|PGP Encrypt|PGP Sign|PGP Sign&Encrypt|Insert your Pub-key|Nothing"`
  47. ELSE
  48.     SET choice "{CHOICE}"
  49. ENDIF
  50.  
  51. IF $choice EQ 0
  52.     ENDCLI >NIL:
  53. ENDIF
  54.  
  55. IF $choice EQ 1
  56.     IF "$editor" NOT EQ ""
  57.         "$editor" "{file}"
  58.     ENDIF
  59. ENDIF
  60.  
  61. IF $choice EQ 2
  62.     SKIP encode
  63. ENDIF
  64.  
  65. IF $choice EQ 3
  66.     SKIP sign
  67. ENDIF
  68.  
  69. IF $choice EQ 4
  70.     SKIP signencode
  71. ENDIF
  72.  
  73. IF $choice EQ 5
  74.     SKIP putkey
  75. ENDIF
  76.  
  77. IF $choice EQ 6
  78.     SKIP decode
  79. ENDIF
  80.  
  81. ENDCLI >NIL:
  82.  
  83.  
  84. LAB encode
  85. path "$pgppath"
  86. pgp -kvf >t:pgpkeys
  87. ECHO >t:edmenu.temp "path *"$pgppath*""
  88. ECHO >>t:edmenu.temp "SelectPGPKey t:pgpkeys"
  89. ECHO >>t:edmenu.temp "pgp -ea *"{file}*" -@t:selected"
  90. ECHO >>t:edmenu.temp "delete *"{file}*" t:selected >NIL:"
  91. ECHO >>t:edmenu.temp "rename *"{file}.asc*" *"{file}*""
  92. ECHO >>t:edmenu.temp "endcli >NIL:"
  93. NEWCLI FROM t:edmenu.temp
  94. ENDCLI >NIL:
  95.  
  96. LAB sign
  97. path "$pgppath"
  98. pgp -kvf >t:pgpkeys
  99. ECHO >t:edmenu.temp "path *"$pgppath*""
  100. ECHO >>t:edmenu.temp "pgp -sta *"{file}*""
  101. ECHO >>t:edmenu.temp "delete *"{file}*" >NIL:"
  102. ECHO >>t:edmenu.temp "rename *"{file}.asc*" *"{file}*""
  103. ECHO >>t:edmenu.temp "endcli >NIL:"
  104. NEWCLI FROM t:edmenu.temp
  105. ENDCLI >NIL:
  106.  
  107. LAB signencode
  108. path "$pgppath"
  109. pgp -kvf >t:pgpkeys
  110. ECHO >t:edmenu.temp "path *"$pgppath*""
  111. ECHO >>t:edmenu.temp "SelectPGPKey t:pgpkeys"
  112. ECHO >>t:edmenu.temp "pgp -sea *"{file}*" -@t:selected"
  113. ECHO >>t:edmenu.temp "delete *"{file}*" t:selected >NIL:"
  114. ECHO >>t:edmenu.temp "rename *"{file}.asc*" *"{file}*""
  115. ECHO >>t:edmenu.temp "endcli >NIL:"
  116. NEWCLI FROM t:edmenu.temp
  117. ENDCLI >NIL:
  118.  
  119. LAB putkey
  120. IF "$keyid" EQ ""
  121.     RequestChoice TITLE "YAPY v1.3 © 1997 Fredrik Rambris" BODY "To use this function you must configure YAPY.*NSee the manual how." GADGETS " Ok " >NIL:
  122.     ENDCLI >NIL:
  123. ENDIF
  124.  
  125. IF "`ECHO "$keyid" FIRST 1 LEN 2`" NOT EQ "0x"
  126.     RequestChoice TITLE "YAPY v1.3 © 1997 Fredrik Rambris" BODY "The keyid must begin with 0x*NSee the manual how." GADGETS " Ok " >NIL:
  127.     quit
  128.     ;ENDCLI >NIL:
  129. ENDIF
  130.  
  131. ECHO >t:edmenu.temp "path *"$pgppath*""
  132. ECHO >>t:edmenu.temp "delete t:key.asc FORCE >NIL:"
  133. ECHO >>t:edmenu.temp "pgp -kxa $keyid t:key"
  134. ECHO >>t:edmenu.temp "echo >>*"{file}*" *"*""
  135. ECHO >>t:edmenu.temp "type t:key.asc >>*"{file}*""
  136. ECHO >>t:edmenu.temp "delete t:key.asc FORCE >NIL:"
  137. ECHO >>t:edmenu.temp "endcli >NIL:"
  138. NEWCLI FROM t:edmenu.temp
  139. ENDCLI >NIL:
  140.  
  141. LAB decode
  142. ECHO >t:edmenu.temp "path *"$pgppath*""
  143. ECHO >>t:edmenu.temp "failat 99999"
  144. ECHO >>t:edmenu.temp "rename *"{file}*" *"{file}.asc*""
  145. ECHO >>t:edmenu.temp "pgp *"{file}.asc*""
  146. ECHO >>t:edmenu.temp "ReplacePGP *"{file}.asc*" *"{file}*""
  147. ECHO >>t:edmenu.temp "Delete *"{file}*" >NIL:"
  148. ECHO >>t:edmenu.temp "rename *"{file}.asc*" *"{file}*""
  149. ECHO >>t:edmenu.temp "endcli >NIL:"
  150. NEWCLI FROM t:edmenu.temp
  151. ENDCLI >NIL:
  152.